
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="utf-8" />
    <title>Introduction to atomman: ElasticConstants class &#8212; atomman 1.4.0 documentation</title>
    <link rel="stylesheet" href="../_static/basic.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>
    <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
    <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Introduction to atomman: NeighborList class" href="3.2._NeighborList_class.html" />
    <link rel="prev" title="Introduction to atomman: Basic support and analysis tools" href="3._Basic_support_and_analysis_tools.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="3.2._NeighborList_class.html" title="Introduction to atomman: NeighborList class"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="3._Basic_support_and_analysis_tools.html" title="Introduction to atomman: Basic support and analysis tools"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">atomman 1.4.0 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Tutorials</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  
<style>
/* CSS for nbsphinx extension */

/* remove conflicting styling from Sphinx themes */
div.nbinput.container div.prompt *,
div.nboutput.container div.prompt *,
div.nbinput.container div.input_area pre,
div.nboutput.container div.output_area pre,
div.nbinput.container div.input_area .highlight,
div.nboutput.container div.output_area .highlight {
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

div.nbinput.container > div[class*=highlight],
div.nboutput.container > div[class*=highlight] {
    margin: 0;
}

div.nbinput.container div.prompt *,
div.nboutput.container div.prompt * {
    background: none;
}

div.nboutput.container div.output_area .highlight,
div.nboutput.container div.output_area pre {
    background: unset;
}

div.nboutput.container div.output_area div.highlight {
    color: unset;  /* override Pygments text color */
}

/* avoid gaps between output lines */
div.nboutput.container div[class*=highlight] pre {
    line-height: normal;
}

/* input/output containers */
div.nbinput.container,
div.nboutput.container {
    display: -webkit-flex;
    display: flex;
    align-items: flex-start;
    margin: 0;
    width: 100%;
}
@media (max-width: 540px) {
    div.nbinput.container,
    div.nboutput.container {
        flex-direction: column;
    }
}

/* input container */
div.nbinput.container {
    padding-top: 5px;
}

/* last container */
div.nblast.container {
    padding-bottom: 5px;
}

/* input prompt */
div.nbinput.container div.prompt pre {
    color: #307FC1;
}

/* output prompt */
div.nboutput.container div.prompt pre {
    color: #BF5B3D;
}

/* all prompts */
div.nbinput.container div.prompt,
div.nboutput.container div.prompt {
    width: 4.5ex;
    padding-top: 5px;
    position: relative;
    user-select: none;
}

div.nbinput.container div.prompt > div,
div.nboutput.container div.prompt > div {
    position: absolute;
    right: 0;
    margin-right: 0.3ex;
}

@media (max-width: 540px) {
    div.nbinput.container div.prompt,
    div.nboutput.container div.prompt {
        width: unset;
        text-align: left;
        padding: 0.4em;
    }
    div.nboutput.container div.prompt.empty {
        padding: 0;
    }

    div.nbinput.container div.prompt > div,
    div.nboutput.container div.prompt > div {
        position: unset;
    }
}

/* disable scrollbars on prompts */
div.nbinput.container div.prompt pre,
div.nboutput.container div.prompt pre {
    overflow: hidden;
}

/* input/output area */
div.nbinput.container div.input_area,
div.nboutput.container div.output_area {
    -webkit-flex: 1;
    flex: 1;
    overflow: auto;
}
@media (max-width: 540px) {
    div.nbinput.container div.input_area,
    div.nboutput.container div.output_area {
        width: 100%;
    }
}

/* input area */
div.nbinput.container div.input_area {
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    /*background: #f5f5f5;*/
}

/* override MathJax center alignment in output cells */
div.nboutput.container div[class*=MathJax] {
    text-align: left !important;
}

/* override sphinx.ext.imgmath center alignment in output cells */
div.nboutput.container div.math p {
    text-align: left;
}

/* standard error */
div.nboutput.container div.output_area.stderr {
    background: #fdd;
}

/* ANSI colors */
.ansi-black-fg { color: #3E424D; }
.ansi-black-bg { background-color: #3E424D; }
.ansi-black-intense-fg { color: #282C36; }
.ansi-black-intense-bg { background-color: #282C36; }
.ansi-red-fg { color: #E75C58; }
.ansi-red-bg { background-color: #E75C58; }
.ansi-red-intense-fg { color: #B22B31; }
.ansi-red-intense-bg { background-color: #B22B31; }
.ansi-green-fg { color: #00A250; }
.ansi-green-bg { background-color: #00A250; }
.ansi-green-intense-fg { color: #007427; }
.ansi-green-intense-bg { background-color: #007427; }
.ansi-yellow-fg { color: #DDB62B; }
.ansi-yellow-bg { background-color: #DDB62B; }
.ansi-yellow-intense-fg { color: #B27D12; }
.ansi-yellow-intense-bg { background-color: #B27D12; }
.ansi-blue-fg { color: #208FFB; }
.ansi-blue-bg { background-color: #208FFB; }
.ansi-blue-intense-fg { color: #0065CA; }
.ansi-blue-intense-bg { background-color: #0065CA; }
.ansi-magenta-fg { color: #D160C4; }
.ansi-magenta-bg { background-color: #D160C4; }
.ansi-magenta-intense-fg { color: #A03196; }
.ansi-magenta-intense-bg { background-color: #A03196; }
.ansi-cyan-fg { color: #60C6C8; }
.ansi-cyan-bg { background-color: #60C6C8; }
.ansi-cyan-intense-fg { color: #258F8F; }
.ansi-cyan-intense-bg { background-color: #258F8F; }
.ansi-white-fg { color: #C5C1B4; }
.ansi-white-bg { background-color: #C5C1B4; }
.ansi-white-intense-fg { color: #A1A6B2; }
.ansi-white-intense-bg { background-color: #A1A6B2; }

.ansi-default-inverse-fg { color: #FFFFFF; }
.ansi-default-inverse-bg { background-color: #000000; }

.ansi-bold { font-weight: bold; }
.ansi-underline { text-decoration: underline; }


div.nbinput.container div.input_area div[class*=highlight] > pre,
div.nboutput.container div.output_area div[class*=highlight] > pre,
div.nboutput.container div.output_area div[class*=highlight].math,
div.nboutput.container div.output_area.rendered_html,
div.nboutput.container div.output_area > div.output_javascript,
div.nboutput.container div.output_area:not(.rendered_html) > img{
    padding: 5px;
    margin: 0;
}

/* fix copybtn overflow problem in chromium (needed for 'sphinx_copybutton') */
div.nbinput.container div.input_area > div[class^='highlight'],
div.nboutput.container div.output_area > div[class^='highlight']{
    overflow-y: hidden;
}

/* hide copybtn icon on prompts (needed for 'sphinx_copybutton') */
.prompt a.copybtn {
    display: none;
}

/* Some additional styling taken form the Jupyter notebook CSS */
div.rendered_html table {
  border: none;
  border-collapse: collapse;
  border-spacing: 0;
  color: black;
  font-size: 12px;
  table-layout: fixed;
}
div.rendered_html thead {
  border-bottom: 1px solid black;
  vertical-align: bottom;
}
div.rendered_html tr,
div.rendered_html th,
div.rendered_html td {
  text-align: right;
  vertical-align: middle;
  padding: 0.5em 0.5em;
  line-height: normal;
  white-space: normal;
  max-width: none;
  border: none;
}
div.rendered_html th {
  font-weight: bold;
}
div.rendered_html tbody tr:nth-child(odd) {
  background: #f5f5f5;
}
div.rendered_html tbody tr:hover {
  background: rgba(66, 165, 245, 0.2);
}
</style>
<div class="section" id="Introduction-to-atomman:-ElasticConstants-class">
<h1>Introduction to atomman: ElasticConstants class<a class="headerlink" href="#Introduction-to-atomman:-ElasticConstants-class" title="Permalink to this headline">¶</a></h1>
<p><strong>Lucas M. Hale</strong>, <a class="reference external" href="mailto:lucas&#46;hale&#37;&#52;&#48;nist&#46;gov?Subject=ipr-demo">lucas<span>&#46;</span>hale<span>&#64;</span>nist<span>&#46;</span>gov</a>, <em>Materials Science and Engineering Division, NIST</em>.</p>
<p><a class="reference external" href="http://www.nist.gov/public_affairs/disclaimer.cfm">Disclaimers</a></p>
<div class="section" id="1.-Introduction">
<h2>1. Introduction<a class="headerlink" href="#1.-Introduction" title="Permalink to this headline">¶</a></h2>
<p>The ElasticConstants class represents the elastic constants of a crystal. The class methods focus on:</p>
<ul class="simple">
<li><p>Allowing values to be set/retrieved in a number of different formats.</p></li>
<li><p>Correctly handling transformations to other Cartesian orientations.</p></li>
</ul>
<p><strong>Library Imports</strong></p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[1]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Standard Python libraries</span>
<span class="kn">import</span> <span class="nn">datetime</span>

<span class="c1"># http://www.numpy.org/</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="n">np</span><span class="o">.</span><span class="n">set_printoptions</span><span class="p">(</span><span class="n">precision</span><span class="o">=</span><span class="mi">4</span><span class="p">,</span> <span class="n">suppress</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>

<span class="c1"># https://github.com/usnistgov/atomman</span>
<span class="kn">import</span> <span class="nn">atomman</span> <span class="k">as</span> <span class="nn">am</span>
<span class="kn">import</span> <span class="nn">atomman.unitconvert</span> <span class="k">as</span> <span class="nn">uc</span>

<span class="c1"># Show atomman version</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;atomman version =&#39;</span><span class="p">,</span> <span class="n">am</span><span class="o">.</span><span class="n">__version__</span><span class="p">)</span>

<span class="c1"># Show date of Notebook execution</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Notebook executed on&#39;</span><span class="p">,</span> <span class="n">datetime</span><span class="o">.</span><span class="n">date</span><span class="o">.</span><span class="n">today</span><span class="p">())</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
atomman version = 1.4.0
Notebook executed on 2021-08-05
</pre></div></div>
</div>
</div>
<div class="section" id="2.-Elastic-constants-representations">
<h2>2. Elastic constants representations<a class="headerlink" href="#2.-Elastic-constants-representations" title="Permalink to this headline">¶</a></h2>
<p>The ElasticConstants object allows for various representations of the elastic constants to be retrieved:</p>
<ul class="simple">
<li><p><strong>Cij</strong> (6, 6) array of Voigt representation of elastic stiffness.</p></li>
<li><p><strong>Sij</strong> (6, 6) array of Voigt representation of elastic compliance.</p></li>
<li><p><strong>Cij9</strong> (9, 9) array representation of elastic stiffness.</p></li>
<li><p><strong>Cijkl</strong> (3, 3, 3, 3) array representation of elastic stiffness.</p></li>
<li><p><strong>Sijkl</strong> (3, 3, 3, 3) array representation of elastic compliance.</p></li>
</ul>
<div class="section" id="2.1.-Build-demonstration-(see-Section-#3-for-more-setting-options)">
<h3>2.1. Build demonstration (see <a class="reference external" href="#section3">Section #3</a> for more setting options)<a class="headerlink" href="#2.1.-Build-demonstration-(see-Section-#3-for-more-setting-options)" title="Permalink to this headline">¶</a></h3>
<div class="nbinput nblast docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[2]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># 0 K values for Al</span>
<span class="n">C11</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">1.143e12</span><span class="p">,</span> <span class="s1">&#39;dyn/cm^2&#39;</span><span class="p">)</span>
<span class="n">C12</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">0.619e12</span><span class="p">,</span> <span class="s1">&#39;dyn/cm^2&#39;</span><span class="p">)</span>
<span class="n">C44</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">0.316e12</span><span class="p">,</span> <span class="s1">&#39;dyn/cm^2&#39;</span><span class="p">)</span>

<span class="n">C</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">ElasticConstants</span><span class="p">(</span><span class="n">C11</span><span class="o">=</span><span class="n">C11</span><span class="p">,</span> <span class="n">C12</span><span class="o">=</span><span class="n">C12</span><span class="p">,</span> <span class="n">C44</span><span class="o">=</span><span class="n">C44</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="2.2.-Show-different-representations">
<h3>2.2. Show different representations<a class="headerlink" href="#2.2.-Show-different-representations" title="Permalink to this headline">¶</a></h3>
<p><strong>Cij</strong> is the 6x6 Voigt representation.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[3]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Cij (GPa) -&gt;&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">C</span><span class="o">.</span><span class="n">Cij</span><span class="p">,</span> <span class="s1">&#39;GPa&#39;</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
Cij (GPa) -&gt;
[[114.3  61.9  61.9   0.    0.    0. ]
 [ 61.9 114.3  61.9   0.    0.    0. ]
 [ 61.9  61.9 114.3   0.    0.    0. ]
 [  0.    0.    0.   31.6   0.    0. ]
 [  0.    0.    0.    0.   31.6   0. ]
 [  0.    0.    0.    0.    0.   31.6]]
</pre></div></div>
</div>
<p><strong>Cij9</strong> is the full 9x9 representation.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[4]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Cij9 (GPa) -&gt;&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">C</span><span class="o">.</span><span class="n">Cij9</span><span class="p">,</span> <span class="s1">&#39;GPa&#39;</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
Cij9 (GPa) -&gt;
[[114.3  61.9  61.9   0.    0.    0.    0.    0.    0. ]
 [ 61.9 114.3  61.9   0.    0.    0.    0.    0.    0. ]
 [ 61.9  61.9 114.3   0.    0.    0.    0.    0.    0. ]
 [  0.    0.    0.   31.6   0.    0.   31.6   0.    0. ]
 [  0.    0.    0.    0.   31.6   0.    0.   31.6   0. ]
 [  0.    0.    0.    0.    0.   31.6   0.    0.   31.6]
 [  0.    0.    0.   31.6   0.    0.   31.6   0.    0. ]
 [  0.    0.    0.    0.   31.6   0.    0.   31.6   0. ]
 [  0.    0.    0.    0.    0.   31.6   0.    0.   31.6]]
</pre></div></div>
</div>
<p><strong>Cijkl</strong> is the full 3x3x3x3 representation.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[5]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Cijkl (GPa) -&gt;&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">C</span><span class="o">.</span><span class="n">Cijkl</span><span class="p">,</span> <span class="s1">&#39;GPa&#39;</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
Cijkl (GPa) -&gt;
[[[[114.3   0.    0. ]
   [  0.   61.9   0. ]
   [  0.    0.   61.9]]

  [[  0.   31.6   0. ]
   [ 31.6   0.    0. ]
   [  0.    0.    0. ]]

  [[  0.    0.   31.6]
   [  0.    0.    0. ]
   [ 31.6   0.    0. ]]]


 [[[  0.   31.6   0. ]
   [ 31.6   0.    0. ]
   [  0.    0.    0. ]]

  [[ 61.9   0.    0. ]
   [  0.  114.3   0. ]
   [  0.    0.   61.9]]

  [[  0.    0.    0. ]
   [  0.    0.   31.6]
   [  0.   31.6   0. ]]]


 [[[  0.    0.   31.6]
   [  0.    0.    0. ]
   [ 31.6   0.    0. ]]

  [[  0.    0.    0. ]
   [  0.    0.   31.6]
   [  0.   31.6   0. ]]

  [[ 61.9   0.    0. ]
   [  0.   61.9   0. ]
   [  0.    0.  114.3]]]]
</pre></div></div>
</div>
<p><strong>Sij</strong> is the Voigt 6x6 elastic compliances.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[6]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Sij (1/GPa) -&gt;&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">C</span><span class="o">.</span><span class="n">Sij</span><span class="p">,</span> <span class="s1">&#39;1/GPa&#39;</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
Sij (1/GPa) -&gt;
[[ 0.0141 -0.005  -0.005   0.      0.      0.    ]
 [-0.005   0.0141 -0.005   0.      0.      0.    ]
 [-0.005  -0.005   0.0141  0.      0.      0.    ]
 [ 0.     -0.     -0.      0.0316 -0.     -0.    ]
 [ 0.      0.      0.      0.      0.0316  0.    ]
 [ 0.      0.      0.      0.      0.      0.0316]]
</pre></div></div>
</div>
<p><strong>Sijkl</strong> is the full 3x3x3x3 elastic compliances.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[7]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Sijkl (1/GPa) -&gt;&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">C</span><span class="o">.</span><span class="n">Sijkl</span><span class="p">,</span> <span class="s1">&#39;1/GPa&#39;</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
Sijkl (1/GPa) -&gt;
[[[[ 0.0141  0.      0.    ]
   [ 0.     -0.005   0.    ]
   [ 0.      0.     -0.005 ]]

  [[ 0.      0.0079  0.    ]
   [ 0.0079  0.      0.    ]
   [ 0.      0.      0.    ]]

  [[ 0.      0.      0.0079]
   [ 0.      0.      0.    ]
   [ 0.0079  0.      0.    ]]]


 [[[ 0.      0.0079  0.    ]
   [ 0.0079  0.      0.    ]
   [ 0.      0.      0.    ]]

  [[-0.005   0.      0.    ]
   [ 0.      0.0141  0.    ]
   [ 0.      0.     -0.005 ]]

  [[ 0.     -0.     -0.    ]
   [-0.     -0.      0.0079]
   [-0.      0.0079 -0.    ]]]


 [[[ 0.      0.      0.0079]
   [ 0.      0.      0.    ]
   [ 0.0079  0.      0.    ]]

  [[ 0.     -0.     -0.    ]
   [-0.     -0.      0.0079]
   [-0.      0.0079 -0.    ]]

  [[-0.005   0.      0.    ]
   [ 0.     -0.005   0.    ]
   [ 0.      0.      0.0141]]]]
</pre></div></div>
</div>
</div>
</div>
<div class="section" id="3.-Setting-values">
<h2>3. Setting values<a class="headerlink" href="#3.-Setting-values" title="Permalink to this headline">¶</a></h2>
<div class="section" id="3.1.-Setting-using-attributes">
<h3>3.1. Setting using attributes<a class="headerlink" href="#3.1.-Setting-using-attributes" title="Permalink to this headline">¶</a></h3>
<p>The values of the elastic constants can be initialized or set using any of the above representations.</p>
<ul class="simple">
<li><p>During initialization, pass one of the following as the only parameter: Cij, Sij, Cij9, Cijkl, or Sijkl.</p></li>
<li><p>For an already initialized object, set any of the representations directly.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[8]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="n">Sijkl</span> <span class="o">=</span> <span class="n">C</span><span class="o">.</span><span class="n">Sijkl</span>

<span class="c1"># Initialize a new C with Sijkl values</span>
<span class="n">newC</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">ElasticConstants</span><span class="p">(</span><span class="n">Sijkl</span> <span class="o">=</span> <span class="n">Sijkl</span><span class="p">)</span>

<span class="c1"># Show values to be the same</span>
<span class="nb">print</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">allclose</span><span class="p">(</span><span class="n">newC</span><span class="o">.</span><span class="n">Cij</span><span class="p">,</span> <span class="n">C</span><span class="o">.</span><span class="n">Cij</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
True
</pre></div></div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[9]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Initialize all zeros elastic constants array</span>
<span class="n">newC</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">ElasticConstants</span><span class="p">()</span>
<span class="nb">print</span><span class="p">(</span><span class="n">newC</span><span class="p">)</span>

<span class="c1"># Set values using Cij9</span>
<span class="n">newC</span><span class="o">.</span><span class="n">Cij9</span> <span class="o">=</span> <span class="n">C</span><span class="o">.</span><span class="n">Cij9</span>

<span class="c1"># Show values to be the same</span>
<span class="nb">print</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">allclose</span><span class="p">(</span><span class="n">newC</span><span class="o">.</span><span class="n">Cij</span><span class="p">,</span> <span class="n">C</span><span class="o">.</span><span class="n">Cij</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
[[0. 0. 0. 0. 0. 0.]
 [0. 0. 0. 0. 0. 0.]
 [0. 0. 0. 0. 0. 0.]
 [0. 0. 0. 0. 0. 0.]
 [0. 0. 0. 0. 0. 0.]
 [0. 0. 0. 0. 0. 0.]]
True
</pre></div></div>
</div>
</div>
<div class="section" id="3.2.-Setting-using-crystal-specific-constants">
<h3>3.2. Setting using crystal-specific constants<a class="headerlink" href="#3.2.-Setting-using-crystal-specific-constants" title="Permalink to this headline">¶</a></h3>
<p>Alternatively, the elastic constants can be defined by supplying a full set of unique constants for a given crystal structure in the standard reference frame. During initialization, the specific form is inferred from the given parameters. After initialization, the functions corresponding to a specific crystal family can be called.</p>
<ul class="simple">
<li><p><strong>isotropic</strong> (two unique values required)</p>
<ul>
<li><p><strong>C11</strong></p></li>
<li><p><strong>C12</strong></p></li>
<li><p><strong>C44</strong> (2*C44 = C11-C12)</p></li>
<li><p><strong>M</strong> P-wave modulus (M = C11)</p></li>
<li><p><strong>lambda</strong> Lame’s first parameter (lambda = C12)</p></li>
<li><p><strong>mu</strong> Shear modulus (mu = C44)</p></li>
<li><p><strong>E</strong> Young’s modulus</p></li>
<li><p><strong>nu</strong> Poisson’s ratio</p></li>
<li><p><strong>K</strong> Bulk modulus</p></li>
</ul>
</li>
<li><p><strong>cubic</strong> (all three values required)</p>
<ul>
<li><p><strong>C11</strong></p></li>
<li><p><strong>C12</strong></p></li>
<li><p><strong>C44</strong></p></li>
</ul>
</li>
<li><p><strong>hexagonal</strong> (five unique values required)</p>
<ul>
<li><p><strong>C11</strong></p></li>
<li><p><strong>C12</strong></p></li>
<li><p><strong>C13</strong></p></li>
<li><p><strong>C33</strong></p></li>
<li><p><strong>C44</strong></p></li>
<li><p><strong>C66</strong> (2*C66 = C11-C12)</p></li>
</ul>
</li>
<li><p><strong>tetragonal</strong> (six values required, one optional)</p>
<ul>
<li><p><strong>C11</strong></p></li>
<li><p><strong>C12</strong></p></li>
<li><p><strong>C13</strong></p></li>
<li><p><strong>C16</strong> optional (C16=0 for some space groups)</p></li>
<li><p><strong>C33</strong></p></li>
<li><p><strong>C44</strong></p></li>
<li><p><strong>C66</strong></p></li>
</ul>
</li>
<li><p><strong>rhombohedral</strong> (six unique values required, one optional)</p>
<ul>
<li><p><strong>C11</strong></p></li>
<li><p><strong>C12</strong></p></li>
<li><p><strong>C13</strong></p></li>
<li><p><strong>C14</strong></p></li>
<li><p><strong>C15</strong> optional (C15=0 for some space groups)</p></li>
<li><p><strong>C33</strong></p></li>
<li><p><strong>C44</strong></p></li>
<li><p><strong>C66</strong> (2*C66 = C11-C12)</p></li>
</ul>
</li>
<li><p><strong>orthorhombic</strong> (all nine values required)</p>
<ul>
<li><p><strong>C11</strong></p></li>
<li><p><strong>C12</strong></p></li>
<li><p><strong>C13</strong></p></li>
<li><p><strong>C22</strong></p></li>
<li><p><strong>C23</strong></p></li>
<li><p><strong>C33</strong></p></li>
<li><p><strong>C44</strong></p></li>
<li><p><strong>C55</strong></p></li>
<li><p><strong>C66</strong></p></li>
</ul>
</li>
<li><p><strong>monoclinic</strong> (all thirteen values required)</p>
<ul>
<li><p><strong>C11</strong></p></li>
<li><p><strong>C12</strong></p></li>
<li><p><strong>C13</strong></p></li>
<li><p><strong>C15</strong></p></li>
<li><p><strong>C22</strong></p></li>
<li><p><strong>C23</strong></p></li>
<li><p><strong>C25</strong></p></li>
<li><p><strong>C33</strong></p></li>
<li><p><strong>C35</strong></p></li>
<li><p><strong>C44</strong></p></li>
<li><p><strong>C46</strong></p></li>
<li><p><strong>C55</strong></p></li>
<li><p><strong>C66</strong></p></li>
</ul>
</li>
<li><p><strong>triclinic</strong> (all twenty-one values required)</p>
<ul>
<li><p><strong>all Cij where i &lt;= j</strong></p></li>
</ul>
</li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[10]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Define dict with Zr HCP constants</span>
<span class="n">Cdict</span> <span class="o">=</span> <span class="p">{}</span>
<span class="n">Cdict</span><span class="p">[</span><span class="s1">&#39;C11&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">144.0</span><span class="p">,</span> <span class="s1">&#39;GPa&#39;</span><span class="p">)</span>
<span class="n">Cdict</span><span class="p">[</span><span class="s1">&#39;C12&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">74.0</span><span class="p">,</span> <span class="s1">&#39;GPa&#39;</span><span class="p">)</span>
<span class="n">Cdict</span><span class="p">[</span><span class="s1">&#39;C13&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">67.0</span><span class="p">,</span> <span class="s1">&#39;GPa&#39;</span><span class="p">)</span>
<span class="n">Cdict</span><span class="p">[</span><span class="s1">&#39;C33&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">166.0</span><span class="p">,</span> <span class="s1">&#39;GPa&#39;</span><span class="p">)</span>
<span class="n">Cdict</span><span class="p">[</span><span class="s1">&#39;C44&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">33.0</span><span class="p">,</span> <span class="s1">&#39;GPa&#39;</span><span class="p">)</span>

<span class="c1"># Initialize by passing dict key-values as parameters</span>
<span class="n">C</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">ElasticConstants</span><span class="p">(</span><span class="o">**</span><span class="n">Cdict</span><span class="p">)</span>

<span class="c1"># Show that Cij array is properly constructed</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Cij (GPa) -&gt;&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">C</span><span class="o">.</span><span class="n">Cij</span><span class="p">,</span> <span class="s1">&#39;GPa&#39;</span><span class="p">))</span>
<span class="nb">print</span><span class="p">()</span>

<span class="c1"># Show that 2 * C66 = C11 - C12</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Does 2*C66 = C11-C12?&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;C11 - C12 (GPa) =&#39;</span><span class="p">,</span> <span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">C</span><span class="o">.</span><span class="n">Cij</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">]</span> <span class="o">-</span> <span class="n">C</span><span class="o">.</span><span class="n">Cij</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">],</span> <span class="s1">&#39;GPa&#39;</span><span class="p">))</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;2 * C66 (GPa) =  &#39;</span><span class="p">,</span> <span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="mi">2</span> <span class="o">*</span> <span class="n">C</span><span class="o">.</span><span class="n">Cij</span><span class="p">[</span><span class="mi">5</span><span class="p">,</span><span class="mi">5</span><span class="p">],</span> <span class="s1">&#39;GPa&#39;</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
Cij (GPa) -&gt;
[[144.  74.  67.   0.   0.   0.]
 [ 74. 144.  67.   0.   0.   0.]
 [ 67.  67. 166.   0.   0.   0.]
 [  0.   0.   0.  33.   0.   0.]
 [  0.   0.   0.   0.  33.   0.]
 [  0.   0.   0.   0.   0.  35.]]

Does 2*C66 = C11-C12?
C11 - C12 (GPa) = 70.0
2 * C66 (GPa) =   70.0
</pre></div></div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[11]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Define dict with Bi2Te3 rhombohedral constants</span>
<span class="n">Cdict</span> <span class="o">=</span> <span class="p">{}</span>
<span class="n">Cdict</span><span class="p">[</span><span class="s1">&#39;C11&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">7.436</span><span class="p">,</span> <span class="s1">&#39;10^11 * dyn/cm^2&#39;</span><span class="p">)</span>
<span class="n">Cdict</span><span class="p">[</span><span class="s1">&#39;C12&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">2.619</span><span class="p">,</span> <span class="s1">&#39;10^11 * dyn/cm^2&#39;</span><span class="p">)</span>
<span class="n">Cdict</span><span class="p">[</span><span class="s1">&#39;C33&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">5.160</span><span class="p">,</span> <span class="s1">&#39;10^11 * dyn/cm^2&#39;</span><span class="p">)</span>
<span class="n">Cdict</span><span class="p">[</span><span class="s1">&#39;C44&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">3.135</span><span class="p">,</span> <span class="s1">&#39;10^11 * dyn/cm^2&#39;</span><span class="p">)</span>
<span class="n">Cdict</span><span class="p">[</span><span class="s1">&#39;C13&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">2.917</span><span class="p">,</span> <span class="s1">&#39;10^11 * dyn/cm^2&#39;</span><span class="p">)</span>
<span class="n">Cdict</span><span class="p">[</span><span class="s1">&#39;C14&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">1.541</span><span class="p">,</span> <span class="s1">&#39;10^11 * dyn/cm^2&#39;</span><span class="p">)</span>

<span class="c1"># Set values to existing C using the rhombohedral function</span>
<span class="n">C</span><span class="o">.</span><span class="n">rhombohedral</span><span class="p">(</span><span class="o">**</span><span class="n">Cdict</span><span class="p">)</span>

<span class="c1"># Show that Cij array is properly constructed</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Cij (GPa) -&gt;&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">C</span><span class="o">.</span><span class="n">Cij</span><span class="p">,</span> <span class="s1">&#39;GPa&#39;</span><span class="p">))</span>
<span class="nb">print</span><span class="p">()</span>

<span class="c1"># Show that 2 * C66 = C11 - C12</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Does 2*C66 = C11-C12?&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;C11 - C12 (GPa) =&#39;</span><span class="p">,</span> <span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">C</span><span class="o">.</span><span class="n">Cij</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">]</span> <span class="o">-</span> <span class="n">C</span><span class="o">.</span><span class="n">Cij</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">],</span> <span class="s1">&#39;GPa&#39;</span><span class="p">))</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;2 * C66 (GPa) =  &#39;</span><span class="p">,</span> <span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="mi">2</span> <span class="o">*</span> <span class="n">C</span><span class="o">.</span><span class="n">Cij</span><span class="p">[</span><span class="mi">5</span><span class="p">,</span><span class="mi">5</span><span class="p">],</span> <span class="s1">&#39;GPa&#39;</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
Cij (GPa) -&gt;
[[ 74.36   26.19   29.17   15.41    0.      0.   ]
 [ 26.19   74.36   29.17  -15.41    0.      0.   ]
 [ 29.17   29.17   51.6     0.      0.      0.   ]
 [ 15.41  -15.41    0.     31.35    0.      0.   ]
 [  0.      0.      0.      0.     31.35   15.41 ]
 [  0.      0.      0.      0.     15.41   24.085]]

Does 2*C66 = C11-C12?
C11 - C12 (GPa) = 48.170000000000016
2 * C66 (GPa) =   48.170000000000016
</pre></div></div>
</div>
</div>
</div>
<div class="section" id="4.-ElasticConstants.tranform()">
<h2>4. ElasticConstants.tranform()<a class="headerlink" href="#4.-ElasticConstants.tranform()" title="Permalink to this headline">¶</a></h2>
<p>The transform() method is included for convenience allowing for the elastic constants to be transformed to a different set of axes.</p>
<p>Parameters</p>
<ul class="simple">
<li><p><strong>axes</strong> (3, 3) array giving three right-handed orthogonal vectors to use for transforming.</p></li>
<li><p><strong>tol</strong> optional relative tolerance to use in identifying near-zero terms.</p></li>
</ul>
<p>Returns a new ElasticConstants object with constants transformed to the new axes.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[12]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Set C back to a cubic system (Cu this time)</span>
<span class="n">Cdict</span> <span class="o">=</span> <span class="p">{}</span>
<span class="n">Cdict</span><span class="p">[</span><span class="s1">&#39;C11&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">1.762</span><span class="p">,</span> <span class="s1">&#39;10^12 * dyn/cm^2&#39;</span><span class="p">)</span>
<span class="n">Cdict</span><span class="p">[</span><span class="s1">&#39;C12&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">1.249</span><span class="p">,</span> <span class="s1">&#39;10^12 * dyn/cm^2&#39;</span><span class="p">)</span>
<span class="n">Cdict</span><span class="p">[</span><span class="s1">&#39;C44&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">0.818</span><span class="p">,</span> <span class="s1">&#39;10^12 * dyn/cm^2&#39;</span><span class="p">)</span>

<span class="n">C</span><span class="o">.</span><span class="n">cubic</span><span class="p">(</span><span class="o">**</span><span class="n">Cdict</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Cij (GPa) -&gt;&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">C</span><span class="o">.</span><span class="n">Cij</span><span class="p">,</span> <span class="s1">&#39;GPa&#39;</span><span class="p">))</span>
<span class="nb">print</span><span class="p">()</span>


<span class="c1"># Transform by a 45 degree rotation around z-axis</span>
<span class="n">axes</span> <span class="o">=</span> <span class="p">[[</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span>
        <span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span>
        <span class="p">[</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">]]</span>
<span class="n">newC</span> <span class="o">=</span> <span class="n">C</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">axes</span><span class="p">)</span>

<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;After transforming, Cij (GPa) -&gt;&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">newC</span><span class="o">.</span><span class="n">Cij</span><span class="p">,</span> <span class="s1">&#39;GPa&#39;</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
Cij (GPa) -&gt;
[[176.2 124.9 124.9   0.    0.    0. ]
 [124.9 176.2 124.9   0.    0.    0. ]
 [124.9 124.9 176.2   0.    0.    0. ]
 [  0.    0.    0.   81.8   0.    0. ]
 [  0.    0.    0.    0.   81.8   0. ]
 [  0.    0.    0.    0.    0.   81.8]]

After transforming, Cij (GPa) -&gt;
[[232.35  68.75 124.9    0.     0.     0.  ]
 [ 68.75 232.35 124.9    0.     0.     0.  ]
 [124.9  124.9  176.2    0.     0.     0.  ]
 [  0.     0.     0.    81.8    0.     0.  ]
 [  0.     0.     0.     0.    81.8    0.  ]
 [  0.     0.     0.     0.     0.    25.65]]
</pre></div></div>
</div>
</div>
<div class="section" id="5.-Shear-and-bulk-modulus-estimates">
<h2>5. Shear and bulk modulus estimates<a class="headerlink" href="#5.-Shear-and-bulk-modulus-estimates" title="Permalink to this headline">¶</a></h2>
<div class="section" id="5.1.-ElasticConstants.bulk()">
<h3>5.1. ElasticConstants.bulk()<a class="headerlink" href="#5.1.-ElasticConstants.bulk()" title="Permalink to this headline">¶</a></h3>
<p>Three style options of estimates are available:</p>
<ul class="simple">
<li><p><strong>‘Voigt’</strong> Voigt estimate.</p></li>
</ul>
<div class="math notranslate nohighlight">
\[K_{Voigt} = \frac{ \left(C_{11} + C_{22} + C_{33} \right) + 2 \left(C_{12} + C_{13} + C_{23} \right) }{9}\]</div>
<ul class="simple">
<li><p><strong>‘Reuss’</strong> Reuss estimate.</p></li>
</ul>
<div class="math notranslate nohighlight">
\[K_{Reuss} = \frac{1}{ \left( S_{11} + S_{22} + S_{33} \right) + 2 \left(S_{12} + S_{13} + S_{23} \right) }\]</div>
<ul class="simple">
<li><p><strong>‘Hill’</strong> Hill estimate (default).</p></li>
</ul>
<div class="math notranslate nohighlight">
\[K_{Hill} = \frac{K_{Reuss} + K_{Voigt}}{2}\]</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[13]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Voigt bulk modulus estimate =&#39;</span><span class="p">,</span> <span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">C</span><span class="o">.</span><span class="n">bulk</span><span class="p">(</span><span class="s1">&#39;Voigt&#39;</span><span class="p">),</span> <span class="s1">&#39;GPa&#39;</span><span class="p">),</span> <span class="s1">&#39;GPa&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Reuss bulk modulus estimate =&#39;</span><span class="p">,</span> <span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">C</span><span class="o">.</span><span class="n">bulk</span><span class="p">(</span><span class="s1">&#39;Reuss&#39;</span><span class="p">),</span> <span class="s1">&#39;GPa&#39;</span><span class="p">),</span> <span class="s1">&#39;GPa&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Hill bulk modulus estimate = &#39;</span><span class="p">,</span> <span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">C</span><span class="o">.</span><span class="n">bulk</span><span class="p">(),</span> <span class="s1">&#39;GPa&#39;</span><span class="p">),</span> <span class="s1">&#39;GPa&#39;</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
Voigt bulk modulus estimate = 142.0 GPa
Reuss bulk modulus estimate = 141.9999999999999 GPa
Hill bulk modulus estimate =  141.99999999999994 GPa
</pre></div></div>
</div>
</div>
<div class="section" id="5.2.-ElasticConstants.shear()">
<h3>5.2. ElasticConstants.shear()<a class="headerlink" href="#5.2.-ElasticConstants.shear()" title="Permalink to this headline">¶</a></h3>
<p>Three style options of estimates are available:</p>
<ul class="simple">
<li><p><strong>‘Voigt’</strong> Voigt estimate.</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\mu_{Voigt} = \frac{ \left( C_{11} + C_{22} + C_{33} \right) - \left( C_{12} + C_{23} + C_{13} \right) +
  3 \left( C_{44} + C_{55} + C_{66} \right) }{15}\]</div>
<ul class="simple">
<li><p><strong>‘Reuss’</strong> Reuss estimate.</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\mu_{Reuss} = \frac{15}{4 \left( S_{11} + S_{22} + S_{33} \right) - 4 \left( S_{12} + S_{23} + S_{13} \right) +
 3 \left( S_{44} + S_{55} + S_{66} \right)}\]</div>
<ul class="simple">
<li><p><strong>‘Hill’</strong> Hill estimate (default).</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\mu_{Hill} = \frac{\mu_{Reuss} + \mu_{Voigt}}{2}\]</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[14]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Voigt shear modulus estimate =&#39;</span><span class="p">,</span> <span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">C</span><span class="o">.</span><span class="n">shear</span><span class="p">(</span><span class="s1">&#39;Voigt&#39;</span><span class="p">),</span> <span class="s1">&#39;GPa&#39;</span><span class="p">),</span> <span class="s1">&#39;GPa&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Reuss shear modulus estimate =&#39;</span><span class="p">,</span> <span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">C</span><span class="o">.</span><span class="n">shear</span><span class="p">(</span><span class="s1">&#39;Reuss&#39;</span><span class="p">),</span> <span class="s1">&#39;GPa&#39;</span><span class="p">),</span> <span class="s1">&#39;GPa&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Hill shear modulus estimate = &#39;</span><span class="p">,</span> <span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">C</span><span class="o">.</span><span class="n">shear</span><span class="p">(),</span> <span class="s1">&#39;GPa&#39;</span><span class="p">),</span> <span class="s1">&#39;GPa&#39;</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
Voigt shear modulus estimate = 59.34000000000001 GPa
Reuss shear modulus estimate = 43.611930991477855 GPa
Hill shear modulus estimate =  51.47596549573894 GPa
</pre></div></div>
</div>
</div>
</div>
<div class="section" id="6.-Crystal-system-normalized-values">
<h2>6. Crystal system normalized values<a class="headerlink" href="#6.-Crystal-system-normalized-values" title="Permalink to this headline">¶</a></h2>
<p>The elastic constants tensor should have certain components that are equal or dependent based on the crystal symmetry of the system. However, calculations of the elastic constants for an atomic system may show some variability across the measured values of these symmetrically-dependent components. The methods listed here help to handle the symmetry components.</p>
<div class="section" id="6.1.-ElasticConstants.normalized_as()">
<h3>6.1. ElasticConstants.normalized_as()<a class="headerlink" href="#6.1.-ElasticConstants.normalized_as()" title="Permalink to this headline">¶</a></h3>
<p>Returns a new ElasticConstants object where values of the current are averaged or zeroed out according to a standard crystal system setting.</p>
<p><strong>NOTE:</strong> no validation checks are made to evaluate whether such normalizations should be done! That is left up to you (compare values before and after normalization).</p>
<p>Parameters</p>
<ul class="simple">
<li><p><strong>crystal_system</strong> (<em>str</em>) Indicates the crystal system representation to use when building a data model.</p></li>
</ul>
<p>Returns</p>
<ul class="simple">
<li><p>(<em>atomman.ElasticConstants</em>) The elastic constants normalized according to the crystal system symmetries.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[15]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Create a new ElasticConstants object with some variability</span>
<span class="n">scale</span> <span class="o">=</span> <span class="n">uc</span><span class="o">.</span><span class="n">set_in_units</span><span class="p">(</span><span class="mf">1e-2</span><span class="p">,</span> <span class="s1">&#39;GPa&#39;</span><span class="p">)</span>
<span class="n">Cij_with_v</span> <span class="o">=</span> <span class="n">C</span><span class="o">.</span><span class="n">Cij</span> <span class="o">+</span> <span class="n">scale</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">rand</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span><span class="mi">6</span><span class="p">)</span> <span class="o">-</span> <span class="n">scale</span><span class="o">/</span><span class="mi">2</span>
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">6</span><span class="p">):</span>
    <span class="k">for</span> <span class="n">j</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="mi">6</span><span class="p">):</span>
        <span class="n">Cij_with_v</span><span class="p">[</span><span class="n">i</span><span class="p">,</span><span class="n">j</span><span class="p">]</span> <span class="o">=</span> <span class="n">Cij_with_v</span><span class="p">[</span><span class="n">j</span><span class="p">,</span> <span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="n">Cij_with_v</span><span class="p">[</span><span class="n">i</span><span class="p">,</span><span class="n">j</span><span class="p">]</span><span class="o">+</span><span class="n">Cij_with_v</span><span class="p">[</span><span class="n">j</span><span class="p">,</span> <span class="n">i</span><span class="p">])</span><span class="o">/</span><span class="mi">2</span>
<span class="n">C_with_v</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">ElasticConstants</span><span class="p">(</span><span class="n">Cij</span><span class="o">=</span><span class="n">Cij_with_v</span><span class="p">)</span>

<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;C_with_v:&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">C_with_v</span><span class="o">.</span><span class="n">Cij</span><span class="p">,</span> <span class="s1">&#39;GPa&#39;</span><span class="p">))</span>
<span class="nb">print</span><span class="p">()</span>

<span class="c1"># Normalize to cubic</span>
<span class="n">C_norm</span> <span class="o">=</span> <span class="n">C_with_v</span><span class="o">.</span><span class="n">normalized_as</span><span class="p">(</span><span class="s1">&#39;cubic&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;C_norm&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">C_norm</span><span class="o">.</span><span class="n">Cij</span><span class="p">,</span> <span class="s1">&#39;GPa&#39;</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
C_with_v:
[[176.1993 124.9016 124.9004   0.0036  -0.0042   0.003 ]
 [124.9016 176.1998 124.9007   0.0003   0.      -0.0041]
 [124.9004 124.9007 176.2035  -0.0011  -0.0004   0.0012]
 [  0.0036   0.0003  -0.0011  81.7983   0.0027   0.0006]
 [ -0.0042   0.      -0.0004   0.0027  81.7951   0.0015]
 [  0.003   -0.0041   0.0012   0.0006   0.0015  81.8033]]

C_norm
[[176.2009 124.9009 124.9009   0.       0.       0.    ]
 [124.9009 176.2009 124.9009   0.       0.       0.    ]
 [124.9009 124.9009 176.2009   0.       0.       0.    ]
 [  0.       0.       0.      81.7989   0.       0.    ]
 [  0.       0.       0.       0.      81.7989   0.    ]
 [  0.       0.       0.       0.       0.      81.7989]]
</pre></div></div>
</div>
</div>
<div class="section" id="6.2.-is_normal()">
<h3>6.2. is_normal()<a class="headerlink" href="#6.2.-is_normal()" title="Permalink to this headline">¶</a></h3>
<p>Checks if current elastic constants agree with values normalized to a specified crystal family (within tolerances).</p>
<p>Parameters</p>
<ul class="simple">
<li><p><strong>crystal_system</strong> (<em>str</em>) Indicates the crystal system representation to use when building a data model.</p></li>
<li><p><strong>atol</strong> (<em>float, optional</em>) Absolute tolerance to use. Default value is 1e-4.</p></li>
<li><p><strong>rtol</strong> (<em>float, optional</em>) Relative tolerance to use. Default value is 1e-4.</p></li>
</ul>
<p>Returns</p>
<ul class="simple">
<li><p>(<em>bool</em>) True if all Cij match within the tolerances, false otherwise.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[16]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="nb">print</span><span class="p">(</span><span class="s2">&quot;C_with_v.is_normal(&#39;cubic&#39;, rtol=1e-4, atol=1e-4) -&gt;&quot;</span><span class="p">,</span> <span class="n">C_with_v</span><span class="o">.</span><span class="n">is_normal</span><span class="p">(</span><span class="s1">&#39;cubic&#39;</span><span class="p">,</span> <span class="n">rtol</span><span class="o">=</span><span class="mf">1e-4</span><span class="p">,</span> <span class="n">atol</span><span class="o">=</span><span class="mf">1e-4</span><span class="p">))</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;C_with_v.is_normal(&#39;cubic&#39;, rtol=1e-7, atol=1e-7) -&gt;&quot;</span><span class="p">,</span> <span class="n">C_with_v</span><span class="o">.</span><span class="n">is_normal</span><span class="p">(</span><span class="s1">&#39;cubic&#39;</span><span class="p">,</span> <span class="n">rtol</span><span class="o">=</span><span class="mf">1e-7</span><span class="p">,</span> <span class="n">atol</span><span class="o">=</span><span class="mf">1e-7</span><span class="p">))</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;C_with_v.is_normal(&#39;hexagonal&#39;) -&gt;&quot;</span><span class="p">,</span> <span class="n">C_with_v</span><span class="o">.</span><span class="n">is_normal</span><span class="p">(</span><span class="s1">&#39;hexagonal&#39;</span><span class="p">))</span>
<span class="nb">print</span><span class="p">()</span>

<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;C_norm.is_normal(&#39;cubic&#39;, rtol=1e-4, atol=1e-4) -&gt;&quot;</span><span class="p">,</span> <span class="n">C_norm</span><span class="o">.</span><span class="n">is_normal</span><span class="p">(</span><span class="s1">&#39;cubic&#39;</span><span class="p">,</span> <span class="n">rtol</span><span class="o">=</span><span class="mf">1e-4</span><span class="p">,</span> <span class="n">atol</span><span class="o">=</span><span class="mf">1e-4</span><span class="p">))</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;C_norm.is_normal(&#39;cubic&#39;, rtol=1e-7, atol=1e-7) -&gt;&quot;</span><span class="p">,</span> <span class="n">C_norm</span><span class="o">.</span><span class="n">is_normal</span><span class="p">(</span><span class="s1">&#39;cubic&#39;</span><span class="p">,</span> <span class="n">rtol</span><span class="o">=</span><span class="mf">1e-7</span><span class="p">,</span> <span class="n">atol</span><span class="o">=</span><span class="mf">1e-7</span><span class="p">))</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;C_norm.is_normal(&#39;hexagonal&#39;) -&gt;&quot;</span><span class="p">,</span> <span class="n">C_norm</span><span class="o">.</span><span class="n">is_normal</span><span class="p">(</span><span class="s1">&#39;hexagonal&#39;</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
C_with_v.is_normal(&#39;cubic&#39;, rtol=1e-4, atol=1e-4) -&gt; True
C_with_v.is_normal(&#39;cubic&#39;, rtol=1e-7, atol=1e-7) -&gt; False
C_with_v.is_normal(&#39;hexagonal&#39;) -&gt; False

C_norm.is_normal(&#39;cubic&#39;, rtol=1e-4, atol=1e-4) -&gt; True
C_norm.is_normal(&#39;cubic&#39;, rtol=1e-7, atol=1e-7) -&gt; True
C_norm.is_normal(&#39;hexagonal&#39;) -&gt; False
</pre></div></div>
</div>
</div>
</div>
<div class="section" id="7.-ElasticConstants.model()">
<h2>7. ElasticConstants.model()<a class="headerlink" href="#7.-ElasticConstants.model()" title="Permalink to this headline">¶</a></h2>
<p>The elastic constants can also be saved/retrieved as a JSON/XML data model. This is useful as it captures not only the elastic constant values but also the associated units.</p>
<p>Parameters</p>
<ul class="simple">
<li><p><strong>model</strong> (<em>DataModelDict, string, or file-like object, optional</em>) Data model containing exactly one ‘elastic-constants’ branch to read.</p></li>
<li><p><strong>unit</strong> (<em>str, optional</em>) Units or pressure to save values in when building a data model. Default value is None (no conversion).</p></li>
<li><p><strong>crystal_system</strong> (<em>str, optional</em>) Indicates the crystal system representation to use when building a data model. Default value is ‘triclinic’ (save all values in Cij).</p></li>
</ul>
<p>Returns</p>
<ul class="simple">
<li><p>(<em>DataModelDict</em>) If model is not given as a parameter.</p></li>
</ul>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[17]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Generate data model based on C</span>
<span class="n">model</span> <span class="o">=</span> <span class="n">C</span><span class="o">.</span><span class="n">model</span><span class="p">(</span><span class="n">unit</span><span class="o">=</span><span class="s1">&#39;GPa&#39;</span><span class="p">,</span> <span class="n">crystal_system</span><span class="o">=</span><span class="s1">&#39;cubic&#39;</span><span class="p">)</span>

<span class="c1"># Show json version of model</span>
<span class="nb">print</span><span class="p">(</span><span class="n">model</span><span class="o">.</span><span class="n">json</span><span class="p">(</span><span class="n">indent</span><span class="o">=</span><span class="mi">4</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
{
    &#34;elastic-constants&#34;: {
        &#34;Cij&#34;: {
            &#34;value&#34;: [
                176.20000000000002,
                124.9,
                124.9,
                0.0,
                0.0,
                0.0,
                124.9,
                176.20000000000002,
                124.9,
                0.0,
                0.0,
                0.0,
                124.9,
                124.9,
                176.20000000000002,
                0.0,
                0.0,
                0.0,
                0.0,
                0.0,
                0.0,
                81.8,
                0.0,
                0.0,
                0.0,
                0.0,
                0.0,
                0.0,
                81.8,
                0.0,
                0.0,
                0.0,
                0.0,
                0.0,
                0.0,
                81.8
            ],
            &#34;shape&#34;: [
                6,
                6
            ],
            &#34;unit&#34;: &#34;GPa&#34;
        }
    }
}
</pre></div></div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[18]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># If crystal_system is not given, model will contain all 21 triclinic constants</span>
<span class="n">model</span> <span class="o">=</span> <span class="n">C</span><span class="o">.</span><span class="n">model</span><span class="p">(</span><span class="n">unit</span><span class="o">=</span><span class="s1">&#39;GPa&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">model</span><span class="o">.</span><span class="n">json</span><span class="p">())</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
{&#34;elastic-constants&#34;: {&#34;Cij&#34;: {&#34;value&#34;: [176.20000000000002, 124.9, 124.9, 0.0, 0.0, 0.0, 124.9, 176.20000000000002, 124.9, 0.0, 0.0, 0.0, 124.9, 124.9, 176.20000000000002, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 81.8, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 81.8, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 81.8], &#34;shape&#34;: [6, 6], &#34;unit&#34;: &#34;GPa&#34;}}}
</pre></div></div>
</div>
<p>The model can also be read in to an ElasticConstants object either during initialization or using the model() method.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[19]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="n">C</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">ElasticConstants</span><span class="p">(</span><span class="n">model</span><span class="o">=</span><span class="n">model</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">C</span><span class="o">.</span><span class="n">Cij</span><span class="p">,</span> <span class="s1">&#39;GPa&#39;</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
[[176.2 124.9 124.9   0.    0.    0. ]
 [124.9 176.2 124.9   0.    0.    0. ]
 [124.9 124.9 176.2   0.    0.    0. ]
 [  0.    0.    0.   81.8   0.    0. ]
 [  0.    0.    0.    0.   81.8   0. ]
 [  0.    0.    0.    0.    0.   81.8]]
</pre></div></div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[20]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="n">newC</span><span class="o">.</span><span class="n">model</span><span class="p">(</span><span class="n">model</span><span class="o">=</span><span class="n">model</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">uc</span><span class="o">.</span><span class="n">get_in_units</span><span class="p">(</span><span class="n">newC</span><span class="o">.</span><span class="n">Cij</span><span class="p">,</span> <span class="s1">&#39;GPa&#39;</span><span class="p">))</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
[[176.2 124.9 124.9   0.    0.    0. ]
 [124.9 176.2 124.9   0.    0.    0. ]
 [124.9 124.9 176.2   0.    0.    0. ]
 [  0.    0.    0.   81.8   0.    0. ]
 [  0.    0.    0.    0.   81.8   0. ]
 [  0.    0.    0.    0.    0.   81.8]]
</pre></div></div>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Introduction to atomman: ElasticConstants class</a><ul>
<li><a class="reference internal" href="#1.-Introduction">1. Introduction</a></li>
<li><a class="reference internal" href="#2.-Elastic-constants-representations">2. Elastic constants representations</a><ul>
<li><a class="reference internal" href="#2.1.-Build-demonstration-(see-Section-#3-for-more-setting-options)">2.1. Build demonstration (see Section #3 for more setting options)</a></li>
<li><a class="reference internal" href="#2.2.-Show-different-representations">2.2. Show different representations</a></li>
</ul>
</li>
<li><a class="reference internal" href="#3.-Setting-values">3. Setting values</a><ul>
<li><a class="reference internal" href="#3.1.-Setting-using-attributes">3.1. Setting using attributes</a></li>
<li><a class="reference internal" href="#3.2.-Setting-using-crystal-specific-constants">3.2. Setting using crystal-specific constants</a></li>
</ul>
</li>
<li><a class="reference internal" href="#4.-ElasticConstants.tranform()">4. ElasticConstants.tranform()</a></li>
<li><a class="reference internal" href="#5.-Shear-and-bulk-modulus-estimates">5. Shear and bulk modulus estimates</a><ul>
<li><a class="reference internal" href="#5.1.-ElasticConstants.bulk()">5.1. ElasticConstants.bulk()</a></li>
<li><a class="reference internal" href="#5.2.-ElasticConstants.shear()">5.2. ElasticConstants.shear()</a></li>
</ul>
</li>
<li><a class="reference internal" href="#6.-Crystal-system-normalized-values">6. Crystal system normalized values</a><ul>
<li><a class="reference internal" href="#6.1.-ElasticConstants.normalized_as()">6.1. ElasticConstants.normalized_as()</a></li>
<li><a class="reference internal" href="#6.2.-is_normal()">6.2. is_normal()</a></li>
</ul>
</li>
<li><a class="reference internal" href="#7.-ElasticConstants.model()">7. ElasticConstants.model()</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="3._Basic_support_and_analysis_tools.html"
                        title="previous chapter">Introduction to atomman: Basic support and analysis tools</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="3.2._NeighborList_class.html"
                        title="next chapter">Introduction to atomman: NeighborList class</a></p>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="3.2._NeighborList_class.html" title="Introduction to atomman: NeighborList class"
             >next</a> |</li>
        <li class="right" >
          <a href="3._Basic_support_and_analysis_tools.html" title="Introduction to atomman: Basic support and analysis tools"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">atomman 1.4.0 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="index.html" >Tutorials</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.0.
    </div>
  </body>
</html>